-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add session and connection properties to QueryJobConfig #1024
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know the exact acceptance criteria for this addition, but at a face value it more or less looks good to me. Had just a few nit comments about type annotations and docstrings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a question about exposing SessionInfo
in the generated docs.
google/cloud/bigquery/job/base.py
Outdated
@@ -990,6 +1003,24 @@ def evaluation_kind(self) -> Optional[str]: | |||
return self._properties.get("evaluationKind") | |||
|
|||
|
|||
class SessionInfo(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(nit) Explicitly inheriting from object is not needed.
Also, shouldn't we expose this class in the top level namespace? And both new classes in the reference docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to docs via job_base.rst
and query.rst
. I noticed in #1023 that we'd missed a few classes, so I migrated some docs back to automodule. Even though I don't think it's the best UX to have so many classes in one page, I'd rather we not forget in the future.
#1029 is not that much different, the differences are the following:
|
That makes sense, but I'd rather stick with a close mapping to the actual REST API. I suspect it's a class because they might want to add a lot more session-related stats in the future.
The docs at https://cloud.google.com/bigquery/docs/reference/rest/v2/ConnectionProperty don't appear to indicate that key/value are optional. I'm not sure how useful a connection property will be without a key/value. Certainly the two existing ones require something for both.
Good catch. Done! |
…apis#1024) * feat: add session and connection properties to QueryJobConfig * add unit tests * adjust types and add versionadded * add missing url * link to ConnectionProperty docs * add resource classes to root module
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes internal issue 202792922 🦕
Closes #1026
Closes #1029